﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Classes.Util
{
    public class clsUtil
    {
        /// <summary>
        /// conta quantas vezes aparece
        /// </summary>
        /// <param name="caracter"></param>
        /// <param name="str"></param>
        /// <returns></returns>
        public static int conta_ocorrencias(char caracter, String str)
        {
            int count = 0;
            for (int i = 0; i < str.Length; i++)
            {
                if (str[i] == caracter)
                {
                    count++;
                }
            }
            return count;
        }
    }
}
